package com.atguigu.spring.aop.impl;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
	
	public static void main(String[] args) {
		
		//1.创建 Spring 的 IOC 容器
		ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
		
		//从 IOC 容器中获取 bean 的实例
		AritthmeticCalculator aritthmeticCalculator = ctx.getBean(AritthmeticCalculator.class);
		
		//使用 bean
		int result = aritthmeticCalculator.add(3, 6);
		System.out.println("result ---> " + result);
		
		result = aritthmeticCalculator.div(21, 7);
		System.out.println("result ---> " + result);
		
	}
}
